print("Нужно вести любой текст,но обезательно со скобками ()")
open2 = ''
close = 0
flag = True
s = input() #()))()()(()() -> 6; 7
for el in s:
    if el == '(' or el=="[" or el=="{" or el=="<":
        open2 += el
    elif el == ')':
        if open2:
            if open2[-1]=="(":
                open2 = open2[:-1]
            else:
                flag = False
            
    elif el == ']':
        if open2:
            if open2[-1]=="[":
                open2 = open2[:-1]
            else:
                flag=False
    elif el == '}':
        if open2:
            if open2[-1]=="{":
                open2 = open2[:-1]
            else:
                flag=False
    elif el == '>':
        if open2:
            if open2[-1]=="<":
                open2 = open2[:-1]
            else:
                flag=False
            
       
if len(open2) > 0:
    print('Неверная')
elif flag==False:
    print('Неверная')
else:
    print('Верная')

    

